package cn.zswltech.gruul.api;

import cn.zswltech.gruul.common.dal.query.DictionaryQuery;
import cn.zswltech.gruul.common.dal.tkmybatis.Page;
import cn.zswltech.gruul.common.dal.vo.DictionarySave;
import cn.zswltech.gruul.common.entity.DictionaryDO;
import cn.zswltech.gruul.common.result.Response;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author Jim
 * @version 1.0.0
 * @descripition:
 * @date 2024/1/29 13:36
 */
//@FeignClient(value = "gruul",path = "/dictionary")
@RequestMapping("dictionary")
public interface DictionaryApi {

    /**
     * 查询字典配置列表
     *
     * @return
     */
    @GetMapping("list")
    Response<Page<DictionarySave>> getDictionaryList(@RequestParam("query") DictionaryQuery query);

    /**
     * 查询字典不分页
     *
     * @param query
     * @return
     */
    @GetMapping("/type/list")
    Response<List<DictionaryDO>> getDictionaryListNoPage(DictionaryQuery query);

    /**
     * 新建字典配置
     *
     * @param dictionarySave
     * @return
     */
    @PostMapping("create")
    Response createDictionary(DictionarySave dictionarySave);

    /**
     * 编辑字典配置
     */
    @PostMapping("update")
    Response updateDictionary(DictionarySave dictionarySave);

    /**
     * 删除字典配置
     *
     * @param myKey
     * @return
     * @
     */
    @PostMapping("delete")
    Response deleteDictionary(String myKey);
}
